package com.orange.common.web.exception;


import com.orange.common.web.common.AppHttpCodeEnum;

/**
 * @Description: 业务异常类
 * @Author: orange
 */
public class BusinessException extends Exception{
    //自定义异常内容，异常code+message构成异常
    private String message;
    private Integer code;

    public BusinessException(AppHttpCodeEnum appHttpCodeEnum){
        super(appHttpCodeEnum.getErrorMessage());
        this.code=appHttpCodeEnum.getCode();
        this.message=appHttpCodeEnum.getErrorMessage();
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
